package com.slowfly.rule.engine.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultTypeEnum {

    NOT_HIT(0, "未命中"),
    PASS(1, "通过"),
    AUDIT(2, "审核"),
    REJECT(3, "拒绝");

    private final int id;
    private final String name;

    public static String getNameById(Integer id) {
        for (ResultTypeEnum resultTypeEnum : ResultTypeEnum.values()) {
            if (resultTypeEnum.id == id) {
                return resultTypeEnum.name;
            }
        }
        return null;
    }
}
